








#include <iostream>
#include<memory>

class Class{};

int priority(){};

int priority_class(std::shared_ptr<Class> pc,int priority){};


int main(int argc, char const *argv[])
{
    //正确用法：
    std::shared_ptr<Class> pc = std::make_shared<Class>();
    priority_class(pc,priority());

    //错误用法:在当前编译器会报错，这里主要考虑三个步骤：1.make_shared,2.priority(),3.shared_ptr,如果步骤2产生异常，程序将产生错误
    //priority_class((std::shared_ptr<Class> pc(new Class)),priority());
    return 0;
}
